import { defineStore } from 'pinia';
import { getLocale } from "@/langs/index";
import { setLanguage } from "@/util/cookies";

export const langStore = defineStore({
    id: 'lang',
    state() {
        return {
            language: getLocale(),
        }
    },
    getters:{},
    actions:{
        setLanguage(language) {
            this.language = language
            setLanguage(language)
        },
    }
})